package com.firepongo.chaos.web.service.init;

import com.firepongo.chaos.web.service.admin.AdminPlatformService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
@Slf4j
public class InitWebService {

    @Autowired
    private InitWebCheckService initWebCheckService;
    @Autowired
    private AdminPlatformService adminPlatformService;

    @PostConstruct
    public void init() {
        initWebCheckService.check();
        if (initWebCheckService.isAdminService())
            return;
        adminPlatformService.platformLogin();
    }


}
